Remainder returns the remainder after the numerator (dividend) has been divided by the denominator (divisor). In a typical division situation, the program expresses a quotient as a whole number (if any) and up to six decimal places. When using Remainder, however, the program performs the division internally, determines the whole number quotient and the remainder, and returns only the remainder.
You can use this function in making conversions (feet to miles, units to grosses, etc.) You can also use it to select every nth item out of an array.
The following examples are applicable to Basic and Crystal syntax:
If Remainder ({file.EXAM#}, 7) = 0 Then
If Remainder({file.EXAM#}, 7) = 0 Then
This flags every 7th exam for grading by a second party.
ToText(Truncate({file.DAYS}/7)) + " week(s), " + ToText(Remainder({file.DAYS},7)) + " day(s)"
Returns "9 week(s), 1 day(s)". Converts days to weeks and days. For example, if the field had a value of 64 days, the formula would return the value of "9 week(s), 1 day(s)."
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |